package com.sourceCode.web.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liyanhao9999@outlook.com
 * @date 2022/4/17 13:31
 */
@ControllerAdvice//专门处理异常的 处理全局异常
public class MyEx {
    @ResponseBody
    @ExceptionHandler(value = {ArithmeticException.class})
    public String Ha(Exception e){
        return "error";
    }
}
